package cn.tedu.micro.service.order.openfeign.client;

import cn.tedu.micro.service.common.JsonResult;
import cn.tedu.micro.service.order.sentinel.OrderFallbackError;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

//需要借助openfeign提供的@FeignClient指定要调用的服务名称
//服务名称需要和nacos中的服务名称一致
@FeignClient(value = "micro-service-cart")
public interface CartClient {
    //调用购物车的新增接口
    @PostMapping("/cart/add")
    JsonResult addCart(@RequestParam("productCode") String productCode,
                       @RequestParam("userId") String userId,
                       @RequestParam("price") Integer price,
                       @RequestParam("count") Integer count);
    //删除购物车的接口
    @PostMapping("/cart/delete")
    JsonResult deleteCart(@RequestParam("productCode") String productCode,
                          @RequestParam("userId") String userId);

}
